﻿namespace MicroCloud.Systems.Database
{
    /// <summary>
    /// 文件简介实体映射配置
    /// </summary>
    public class FileConfiguration : EntityTypeConfigurationBase<FileEntity, long>
    {
        /// <summary>
        /// 重写以实现实体类型各个属性的数据库配置
        /// </summary>
        /// <param name="builder">实体类型创建器</param>
        public override void Configuration(EntityTypeBuilder<FileEntity> builder)
        {
            builder.HasIndex(m => new { m.SHA1, m.MD5 }).SetIndex("HashMD5", false);
            builder.HasIndex(m => m.FileName).SetIndex("FileName", false);
            builder.HasIndex(m => m.FileExtension).SetIndex("FileExtension", false);

        }
     
    }
}
